import { create } from 'zustand'

export const themeStore = create(set => ({
    theme: {},
    logo: {},
    menu: {},
    head: {},
    body: {},
    updateTheme: e => set(state => ({ ...state, theme: e })),
    updateLogo: e => set(state => ({ ...state, logo: e })),
    updateMenu: e => set(state => ({ ...state, menu: e })),
    updateHead: e => set(state => ({ ...state, head: e })),
    updateBody: e => set(state => ({ ...state, body: e })),
}))

export const pageStore = create(set => ({
    pageActive: '',
    pageList: [],
    updateActive: e => set(state => ({ ...state, pageActive: e })),
    updateList: e => set(state => ({ ...state, pageList: e })),
}))

export const modelStore = create(set => ({
    modelConfig: {},
    updateModel: e => set(state => ({ ...state, modelConfig: e }))
}))
export const modelStore1 = create(set => ({
    modelConfig1: {},
    updateModel1: e => set(state => ({ ...state, modelConfig: e }))
}))
export const modelStore2 = create(set => ({
    modelConfig2: {},
    updateModel2: e => set(state => ({ ...state, modelConfig: e }))
}))

export const drawerStore = create(set => ({
    drawerConfig: {},
    updateDrawer: e => set(state => ({ ...state, drawerConfig: e }))
}))

export const drawerStore1 = create(set => ({
    drawerConfig1: {},
    updateDrawer1: e => set(state => ({ ...state, drawerConfig: e }))
}))

export const drawerStore2 = create(set => ({
    drawerConfig2: {},
    updateDrawer2: e => set(state => ({ ...state, drawerConfig: e }))
}))

export const fromStore = create(set => ({
    fromData: {},
    loading: false,
    updateFromData: e => set(state => ({ ...state, fromData: e })),
    updateFromLoad: e => set(state => ({ ...state, loading: e })),
}))

export const refreshStore = create(set => ({
    refresh: new Date().getTime(),
    updateRefresh: e => set(state => ({ ...state, refresh: e }))
}))

export const devChartsStore = create(set => ({
    devPivot: {},
    updateDevPivot: e => set(state => ({ ...state, devPivot: e }))
}))

